import time

import numpy as np


def init_system_audio():
    import soundcard as sc
    speaker = sc.default_speaker()
    print(f"使用系统输出设备: {speaker.name}")
    return speaker


def fallback_system_audio_capture(chunk, rate):
    while True:
        yield np.zeros(chunk, dtype=np.float32)
        time.sleep(chunk / rate)
